package com.javajun.spider.bt7086.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.javajun.spider.bt7086.entity.Video;
import com.javajun.spider.bt7086.service.VideoService;

@Controller
@RequestMapping(value = "/play")
public class PlayController {
	
	@Autowired
	private VideoService service;

	@GetMapping
	public Object play(@RequestParam(name = "id", defaultValue = "1") int id, ModelMap map) {
		Video model = service.findById(id);
		map.put("model", model);
		return "play";
	}
}
